﻿/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Extended Code Document Object Model
 * Version 2.10
 * 
 * TemplateClass Class
 *      Provides a class template.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using Adaptive.Foundation;

namespace Adaptive.Foundation.CodeDom.Expressions
{
    /// <summary>
    /// 
    /// </summary>
    public class CodeArgumentReferenceExpressionEx : CodeArgumentReferenceExpression, IRenderable, IParseable, IXmlStorable 
    {
        /*--------------------------------------------------------------------------------
         * Public Event Definitions
         *------------------------------------------------------------------------------*/
        #region Public Event Definitions
        /// <summary>
        /// Occurs before parsing begins.
        /// </summary>
        public event EventHandler ParseBegin;
        /// <summary>
        /// Occurs once parsing completes.
        /// </summary>
        public event EventHandler ParseEnd;
        /// <summary>
        /// Occurs when an exception is caught during parsing,
        /// </summary>
        public event ExceptionEventHandler ParseException;
        /// <summary>
        /// Occurs before rendering begins.
        /// </summary>
        public event EventHandler RenderBegin;
        /// <summary>
        /// Occurs once rendering completes.
        /// </summary>
        public  event EventHandler RenderEnd;
        /// <summary>
        /// Occurs when an exception is caught during rendering,
        /// </summary>
        public event ExceptionEventHandler RenderException;
        #endregion

        /*--------------------------------------------------------------------------------
         * Private Member Declarations
         *------------------------------------------------------------------------------*/
        #region Private Member Declarations
        /// <summary>
        /// Tab indention value.
        /// </summary>
        private int _tabIndex;

        #endregion

        /*--------------------------------------------------------------------------------
         * Constructor / Dispose / Destructor Methods
         *------------------------------------------------------------------------------*/
        #region Constructor / Dispose / Destructor Methods
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <remarks>
        /// This is the default constructor.
        /// </remarks>
        public CodeArgumentReferenceExpressionEx()
            : base()
        {
        }
        /// <summary>
        /// Deallocates internally allocated objects.
        /// </summary>
        /// <param name="disposing">
        /// A value indicating whether the object is being disposed.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
            }

            
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Public Properties
         *------------------------------------------------------------------------------*/
        #region Public Properties
        /// <summary>
        /// Gets or sets the number of tab indentions to use.
        /// </summary>
        /// <value>
        /// The number of tab indentions to use when rendering.
        /// </value>
        public int TabIndex
        {
            get { return _tabIndex; }
            set { _tabIndex = value; }
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Protected Methods / Event Methods
         *------------------------------------------------------------------------------*/
        #region Protected Methods / Event Methods
        /// <summary>
        /// Raises the <see cref="ParseBegin"/> event.
        /// </summary>
        /// <param name="e">
        /// An <see cref="EventArgs"/> event arguments instance.
        /// </param>
        protected virtual void OnParseBegin(EventArgs e)
        {
            if (ParseBegin != null)
                ParseBegin(this, e);
        }
        /// <summary>
        /// Raises the <see cref="ParseBegin"/> event.
        /// </summary>
        /// <param name="e">
        /// An <see cref="EventArgs"/> event arguments instance.
        /// </param>
        protected virtual void OnParseEnd(EventArgs e)
        {
            if (ParseEnd != null)
                ParseEnd(this, e);
        }
        /// <summary>
        /// Raises the <see cref="ParseException"/> event.
        /// </summary>
        /// <param name="e">
        /// An <see cref="ExceptionEventArgs"/> event arguments instance 
        /// containing the exception that was caught.
        /// </param>
        protected virtual void OnParseException(ExceptionEventArgs e)
        {
            if (ParseException != null)
                ParseException(this, e);
        }
        /// <summary>
        /// Raises the <see cref="RenderBegin"/> event.
        /// </summary>
        /// <param name="e">
        /// An <see cref="EventArgs"/> event arguments instance.
        /// </param>
        protected virtual void OnRenderBegin(EventArgs e)
        {
            if (RenderBegin != null)
                RenderBegin(this, e);
        }
        /// <summary>
        /// Raises the <see cref="RenderBegin"/> event.
        /// </summary>
        /// <param name="e">
        /// An <see cref="EventArgs"/> event arguments instance.
        /// </param>
        protected virtual void OnRenderEnd(EventArgs e)
        {
            if (RenderEnd != null)
                RenderEnd(this, e);
        }
        /// <summary>
        /// Raises the <see cref="RenderException"/> event.
        /// </summary>
        /// <param name="e">
        /// An <see cref="ExceptionEventArgs"/> event arguments instance 
        /// containing the exception that was caught.
        /// </param>
        protected virtual void OnRenderException(ExceptionEventArgs e)
        {
            if (RenderException != null)
                RenderException(this, e);
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Public Methods / Functions
         *------------------------------------------------------------------------------*/
        #region Public Methods / Functions
        /// <summary>
        /// Parses the supplied text into the Code DOM graph.
        /// </summary>
        /// <param name="language">
        /// A <see cref="VisualStudioLanguages"/> enumerated value
        /// indicating the language the <i>contentToParse</i> parameter is 
        /// written in.
        /// </param>
        /// <param name="contentToParse">
        /// The code content to be parsed.
        /// </param>
        /// <returns>
        /// <b>true</b> if the operation is successful; otherwise, returns
        /// <b>false</b>.
        /// </returns>
        public bool Parse(VisualStudioLanguages language, string contentToParse)
        {
            return false;
        }
        /// <summary>
        /// Parses the supplied text into the Code DOM graph.
        /// </summary>
        /// <param name="parserInstance">
        /// An <see cref="ICodeParser"/> instance used to perform parsing tasks.
        /// </param>
        /// <param name="contentToParse">
        /// The code content to be parsed.
        /// </param>
        /// <returns>
        /// <b>true</b> if the operation is successful; otherwise, returns
        /// <b>false</b>.
        /// </returns>
        public bool Parse(ICodeParser parserInstance, string contentToParse)
        {
            return false;
        }
        /// <summary>
        /// Renders the item into the specified language.
        /// </summary>
        /// <param name="language">
        /// A <see cref="VisualStudioLanguages"/> enumerated value 
        /// indicating the language to render into.
        /// </param>
        /// <returns>
        /// The rendered text or an empty string.
        /// </returns>
        public string Render(VisualStudioLanguages language)
        {
            return string.Empty;
        }
        /// <summary>
        /// Renders the item using the specified code provider.
        /// </summary>
        /// <param name="language">
        /// An <see cref="ICodeGenerator"/> implementation used 
        /// to render text.
        /// </param>
        /// <returns>
        /// The rendered text or an empty string.
        /// </returns>
        public string Render(ICodeGenerator generator)
        {
            return string.Empty;
        }
        /// <summary>
        /// Attempts to save the specific object instance to an open stream.
        /// </summary>
        /// <param name="writer">
        /// An open <see cref="XmlWriter"/> instance used to write the content
        /// to the open stream.
        /// </param>
        /// <returns>
        /// <b>true</b> if the operation is successful; otherwise, returns <b>false</b>.
        /// </returns>
        public bool Save(System.Xml.XmlWriter writer)
        {
            return false;
        }
        /// <summary>
        /// Attempts to load the specific object content from an open stream.
        /// </summary>
        /// <param name="reader">
        /// An open <see cref="XmlReader"/> instance used to reader content
        /// from the open stream.
        /// </param>
        /// <returns>
        /// <b>true</b> if the operation is successful; otherwise, returns <b>false</b>.
        /// </returns>
        public bool Load(System.Xml.XmlReader reader)
        {
            return false;
        }
        /// <summary>
        /// Returns an XML representation of the current object instance.
        /// </summary>
        /// <returns>
        /// XML Code representing the current object instance.
        /// </returns>
        public string ToXml()
        {
            return string.Empty;
        }

        #endregion

        /*--------------------------------------------------------------------------------
         * Private Event Handlers
         *------------------------------------------------------------------------------*/
        #region Private Event Handlers
        #endregion

        /*--------------------------------------------------------------------------------
         * Private Methods / Functions
         *------------------------------------------------------------------------------*/
        #region Private Methods / Functions
        #endregion

    }
}
